﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;

namespace EDMS
{
    public partial class VoterCheck : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (isCheck(txtCID.Text, txtYzm.Text))
            {
                Frame.Global.GlobalFunctions.Alert("验证通过！");
            }
            else
            {
                Frame.Global.GlobalFunctions.Alert("验证失败！");
            }
        }
        //委托人认证
        public static bool isCheck(string Cid, string Pwd)
        {
            using (DataClassesDataContext dc = new DataClassesDataContext())
            {
                Wtjl w = dc.Wtjl.FirstOrDefault(o => o.wtrsfzh == Cid && o.yzm == Pwd);
                if (w == null)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
        }
    }
}